using Core.Domain.Bases;
using Core.Domain.Entities;
using Core.Domain.Enums;

namespace TallyJ.FrontDesk
{
  public class ResultItem
  {
    public ResultItem(bool saveVoter)
    {
      if (saveVoter && Voter != null)
      {
        Voter.Save();
      }
    }

    public string Name { private get; set; }

    public BallotSubmissionMethod Method { private get; set; }

    public string DisplayMain
    {
      get { return Name; }
    }

    public string DisplaySub
    {
      get
      {
        if (Method.ToString() != string.Empty)
        {
          return Method.DisplayName;
        }
        return string.Empty;
/*

        if(display.HasContent())
        {
          return string.Format(" [{0}]", display);
        }
        return string.Empty;
*/
      }
    }

    public Voter Voter { get; set; }
  }
}